<template lang="pug">
  .zgplugin-radio.zgplugin-empty(v-if="(!exist || !show)&&editor")
    svg-icon.empty-icon(icon-class="组件单选框")
  el-form-item(v-show="show" v-else-if="exist" ref="formItem" class="zgplugin-radio"   :prop="config.propertyName"  :rules="rules"  label-width="0px")
    div(v-if="scope")
      requiredLabel(:required="required" :label="config.label")
      radioNormal(v-if="config.radioType==='radioNormal'||!config.radioType" @change="change" ref='radioNormal' :options="options" :editor="editor" :config="config"  v-model="scope[config.propertyName]" :readonly="readonly")
      radioButton(v-if="config.radioType==='radioButton'" @change="change" ref='radioButton' :options="options" :editor="editor" :config="config"  v-model="scope[config.propertyName]" :readonly="readonly")
    div(v-else)
      requiredLabel(:required="required" :label="config.label")
      radioNormal(v-if="config.radioType==='radioNormal'||!config.radioType" @change="change" ref='radioNormal' :options="options" :editor="editor" :config="config"  v-model="rootForm.properties[config.propertyName]" :readonly="readonly")
      radioButton(v-if="config.radioType==='radioButton'" @change="change" ref='radioButton' :options="options" :editor="editor" :config="config"  v-model="rootForm.properties[config.propertyName]" :readonly="readonly")
</template>
<script>
import radioNormal from './radioNormal'
import radioButton from './radioButton'
import renderCommon from '../common/renderCommon'

export default {
  name: 'radioRender',
  components: { radioNormal, radioButton },
  mixins: [renderCommon]
}
</script>
<style lang="scss">
  .zgplugin-radio {
    margin-top: 16px;
    margin-bottom: 0 !important;
  }

</style>
